package com.meida.module.cms.provider.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.meida.common.mybatis.model.*;


import org.springframework.web.bind.annotation.RestController;
import com.meida.common.springmvc.base.BaseController;
import com.meida.module.cms.client.entity.NewsContent;
import com.meida.module.cms.provider.service.NewsContentService;


/**
 * 新闻资讯  控制器
 *
 * @author flyme
 * @date 2019-10-08
 */
@RestController
@RequestMapping("/news/content/")
public class NewsContentController extends BaseController<NewsContentService, NewsContent> {

    @ApiOperation(value = "新闻资讯-分页列表", notes = "新闻资讯  分页列表 ")
    @GetMapping(value = "page")
    public ResultBody pageList(@ModelAttribute(value = "pageModel") PageModel pageModel) {
        return bizService.pageList(pageModel);
    }

    @ApiOperation(value = "新闻资讯-列表", notes = "新闻资讯  列表 ")
    @GetMapping(value = "list")
    public ResultBody list(@ModelAttribute(value = "listModel") ListModel listModel) {
        return bizService.listEntityMap(listModel);
    }

    @ApiOperation(value = "新闻资讯-添加", notes = "添加新闻资讯  ")
    @PostMapping(value = "save")
    public ResultBody save(@ModelAttribute(value = "updateModel") SaveModel saveModel) {
        return bizService.add(saveModel);
    }

    @ApiOperation(value = "新闻资讯-更新", notes = "更新新闻资讯  ")
    @PostMapping(value = "update")
    public ResultBody update(@ModelAttribute(value = "updateModel") UpdateModel updateModel) {
        return bizService.edit(updateModel);
    }

    @ApiOperation(value = "新闻资讯-删除", notes = "删除新闻资讯  ")
    @PostMapping(value = "delete")
    public ResultBody delete(@ModelAttribute(value = "deleteModel") DeleteModel deleteModel) {
        return bizService.delete(deleteModel);
    }


    @ApiOperation(value = "新闻资讯-详情", notes = "新闻资讯  详情")
    @GetMapping(value = "get")
    public ResultBody get(@ModelAttribute(value = "getModel") GetModel getModel) {
        return bizService.get(getModel);
    }
}
